﻿@model String
@{
    Layout = null;
}
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<script src="~/Administration/Content/ueditor/ueditor.config.js?v=20180606"></script>
<script src="~/Administration/Content/ueditor/ueditor.all.js?v=20181109"></script>
<script src="~/Administration/Content/ueditor/lang/zh-cn/zh-cn.js?v=20180606"></script>
<div style="width:100%;" >
    @*<script id="editor" type="text/plain" style="width:100%;height:500px;">
    </script>*@    
    @Html.TextAreaFor(model => model, new { @style = "width:100%;height:500px;" })
</div>
<script type="text/javascript">

    //实例化编辑器
    //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
    var ue = UE.getEditor('@ViewData.TemplateInfo.GetFullHtmlFieldId(string.Empty)');
    //对编辑器的操作最好在编辑器ready之后再做
    ue.ready(function () {
        //设置编辑器的内容
        //ue.setContent('@@Html.Raw(Model)');//有换行的数据不显示
        ////获取html内容，返回: <p>hello</p>
        //var html = ue.getContent();
        ////获取纯文本内容，返回: hello
        //var txt = ue.getContentTxt();
        @*ue.addListener("blur", function () {
            var html = ue.getContent();
            $("#@ViewData.TemplateInfo.GetFullHtmlFieldId(string.Empty)").val(html);
        })*@
    });
</script>
